package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000118650026";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDDAKNrjhtUtLS7CdE6D5+W447om4iqC9biRaodoprba5HfV5aC3qyPxy0Fc3AqOou/ijT2k17YCsqu3vIQiI+lcKurNMUC8DfIynuNjMkJ2wfDQaibqt4q0BOeTiGDCf60sh8xwqi+ZyU8k/gxsitp8I45vcxuWL70N4OKm8IV0bCfNBNuXkicyGhLfAxOEEAvEC+cull1VbaxNfsm8xugEOdZYQl8otolKfW71uYleyHddgmXpGflJ27K3Bf8hNxocN8YMbEP+RDCW/ZNEs78PF4z7ZPy066FviA8mNjBx4EObh1pQ9AAjvzyGENKlvYYaYdkW652mCPVYbgnero1AgMBAAECggEAXa6n1BswXDB4h0b/InKxC++FD5DxRihr8sbfJF+jH/j82pycrYDGzEg3A+BiqZb43mtKaI+CSC5fE0X+ax0ATc3kW1r9rxyy4B8O3oEdcEOu5gpcM3USSOUwF6SXivm5SRwtyl0nblnlVMYNvepH2xx7Z5gcZ4LxMiidZHDR/GKpsjVnveguLnR2XuIgqovJP70zOfbKOrp4TlwREi73BiYg5EHui8DJt8I3K3xtu5uan6zAtwIV/rMvFj+E+xHbONIxxmNsGkiEE7eH/Wf0eI1gA0e+cN3Y5kAqvhZL9pjJ5oEYHEY1VBJRSCAyWaee7H2kRsyG8ctZO9kl73sgfQKBgQD80aS41MrQKpVpiiLsbVdv0UO9e+NSxhYyrAyXlobAY+sirPzt2vt+FrLgYGnLXcvynePv8gmHI3bturcd7BnizUIaftq6oeSfrknGNwi5zyFPgg6DcnJuKGRAKwGTn0D7DdXtrwR3UtweSWB1U8hvpiDybeKDzO6vRXXUa4cxWwKBgQDFdMMXSDHoWqF4cm0OkeO9BuaHpjn8NTLCE4SKWrwkjdQw6ID/m2HULWU+smOSzrLRMko6dwh3Mgg0jmt6REUIuVxtDrT98f96OUXcn5TWNwCP/paD3YAPpuLQsPJ9XmUeKz2pHkM0Itvtfof9wir1zkNniDhydrYr9+M5TmuHrwKBgQCguaa+2okVTf0u22LYa6rqq18lV11tggEatcZLmKaSKPOTV+Z0UIMR5dxSSPj5EOhXlYkTQgxMnX8+IzXHEBJk3ZjovzzO6Z0u5t5/5PznI4dJxKT1bAzTe1pAcRbPgq8M6/7U3C86rLLDjmKENH94e2T2umUG5YHYa5A9Ox73gQKBgQCi3K65OlPnyTEbro2jEdPcqp9kTUfQbXSDPSP6FeLO56iX+n3D1j53ikXS08JraU92Wtt8o4d5AOxhpQKjI0IpcvH4BcRlHMBS6IBl+74AffdZzWwKMZ0Zy9WSuhAYNc6DdrjyD8LwcrwhhFbYh9l1Sv6vm1yrlJynYVuqfbMVgwKBgC9SQFvlvlOWyRXE2ZFRdxJ/khwdQg9i++GzVToSDeKVnuXE5JTjSwK4/mUcQpTA1P4h7MZabyhYa+Kzb0dIIU3bLH7uNtaqX3He/TbcUdxzMyoq682kjRVyTm7yqoH+Db//1K+pk0V1ATyqnrmxzl3TGRRzHTWUOso9HvNAVItJ";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiBOQXaBoq2sVE0mywmezQ82pclpO1nMJlmlEQC16ppEQ4d6Le4Us0XfBp/7+662Ep4aKf998HuhuY+YqHv5fdLh8ruCwxUanlZpSGXRJCwGSWowax6JD3GPHiat/c8nMVgSWATP3yJ5Xz/2mg+teLSNzfcBeugjMtng0eeOuOhEIS8LkRUvTz0aL8luF9axbBfzdFx9RG395yeWAJCaoMmW2r8+PJcWjnZATOiMhJB2iRrtIWvTvwQ/FfmxlkY9et+Sy43HCQMv0vqjs8b5LCO99U7BQe4XFbaByUbzGl8ZXJNkzIu0tTo1BTswAautSATMqwXeZZSlY3bbPNNKKFwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://eeubqa.natappfree.cc/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://eeubqa.natappfree.cc/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

